home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 October / MACPOWER-1997-10.ISO.7z / MACPOWER-1997-10.ISO / AMUG / PROGRAMMING / Mac F2C 1.3.5.sit / Mac F2C 1.3.5 / Mac F2C Libraries / libF77 Sources / s_stop.c < prev    next >
Text File  |  1995-09-12  |  968b  |  52 lines

  1. /* IMT 10Sep95  Declare jump buffer used to recover from exception exits & aborts */
  2. #if defined(TPM_F2C) || defined(SPM_F2C) || defined(CW_F2C) 
  3. #include <setjmp.h>
  4. extern jmp_buf gRecoverToConsole;
  5. #endif /* Macintosh C compilers */
  6.  
  7.  
  8. #include "stdio.h"
  9. #include "f2c.h"
  10.  
  11. #ifdef KR_headers
  12. extern void f_exit();
  13. VOID s_stop(s, n) char *s; ftnlen n;
  14. #else
  15. #undef abs
  16. #undef min
  17. #undef max
  18. #include "stdlib.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. void f_exit(void);
  23.  
  24. int s_stop(char *s, ftnlen n)
  25. #endif
  26. {
  27. int i;
  28.  
  29. if(n > 0)
  30.     {
  31.     fprintf(stderr, "STOP ");
  32.     for(i = 0; i<n ; ++i)
  33.         putc(*s++, stderr);
  34.     fprintf(stderr, " statement executed¥n");
  35.     }
  36. #ifdef NO_ONEXIT
  37. f_exit();
  38. #endif
  39.  
  40. /* IMT 10Sep95  Declare jump buffer used to recover from exception exits & aborts */
  41. #if defined(TPM_F2C) || defined(SPM_F2C) || defined(CW_F2C) 
  42. longjmp( gRecoverToConsole, 1 );
  43. #else
  44. exit(0);
  45. #endif /* Macintosh compilers */
  46.  
  47. #ifdef __cplusplus
  48. return 0; /* NOT REACHED */
  49. }
  50. #endif
  51. }
  52.